<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 企业管理 控制器
 */
class Enterprise extends AdminBase
{

    /**
     * 企业信息列表
     */
    public function enterpriseList()
    {

        $this->assign('list', $this->logicEnterprise->getEnterpriseList());

        return $this->fetch('enterprise_list');
    }

    /**
     * 企业添加
     */
    public function enterpriseAdd()
    {

        IS_POST && $this->jump($this->logicEnterprise->enterpriseEdit($this->param));

        return $this->fetch('enterprise_edit');
    }

    /**
     * 企业编辑
     */
    public function enterpriseEdit()
    {

        IS_POST && $this->jump($this->logicEnterprise->enterpriseEdit($this->param));

        $info = $this->logicEnterprise->getEnterpriseInfo(['id' => $this->param['id']]);

        $this->assign('info', $info);

        return $this->fetch('enterprise_edit');
    }
     /**
     * 数据状态设置
     */
     public function setStatus()
    {
        sf($this->param);
        $this->jump($this->logicAdminBase->setStatus('enterprise', $this->param));
    }

    /**
     * 企业删除
     */
    public function enterpriseDel($id = 0)
    {

        $this->jump($this->logicEnterprise->enterpriseDel(['id' => $id]));
    }
}
